package com.bg.sparkproject.pattern.adapter.obj;

import com.bg.sparkproject.pattern.adapter.Ps2;
import com.bg.sparkproject.pattern.adapter.Usb;
import com.bg.sparkproject.pattern.adapter.UsbImpl;

/**
 * @Auther: zhengshunzhi
 * @Date: 2019/1/3 18:25
 * @Description: 对象适配器
 */
public class Apapter implements Ps2 {
    private Usb usb;

    public Apapter(Usb usb) {
        this.usb = usb;
    }

    @Override
    public void isPs2() {
        usb.isUsb();
    }

    public static void main(String[] args) {
        Ps2 p = new Apapter(new UsbImpl());
        p.isPs2();
    }
}
